package com.maiji.cloud.entities.shopingmall;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.Version;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.maiji.cloud.response.login.UploadImageResData;
import com.maiji.cloud.response.login.UserInfoResData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;

/**
 *  商品评论表
 */
@NoArgsConstructor
@Data
@Accessors(chain=true)
@Table(name = "goods_comment")
public class GoodsComment {

    @TableId
    @Column(name = "uu_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
    private String uuId;

    @ApiModelProperty(value="订单ID")
    @Column(name = "order_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String orderId;

    @ApiModelProperty(value="订单编号")
    @Column(name = "order_no", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String orderNo;

    @ApiModelProperty(value="商品ID")
    @Column(name = "goods_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String goodsId;  // 商品ID

    @ApiModelProperty(value="评论者ID")
    @Column(name = "user_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String userId;  // 评论者ID

    @ApiModelProperty(value="评论文本")
    @Column(name = "content", type = MySqlTypeConstant.TEXT)
    private String content;  // 评论者文本内容

    @ApiModelProperty(value="五星评价")
    @Column(name = "star", type = MySqlTypeConstant.INT, length = 1)
    private Integer star;

    @ApiModelProperty(value="查看次数")
    @Column(name = "look_up_no", type = MySqlTypeConstant.INT, length = 2, defaultValue = "0")
    private Integer lookUpNo; // 查看次数

    @ApiModelProperty(value="点赞次数")
    @Column(name = "thumbs_up_no", type = MySqlTypeConstant.INT, length = 2, defaultValue = "0")
    private Integer thumbsUpNo; // 点赞次数

    @ApiModelProperty(value="评论数")
    @Column(name = "comment_volume", type = MySqlTypeConstant.INT, length = 2, defaultValue = "0")
    private Integer commentVolume; // 评论数

    @ApiModelProperty(value="评论时间")
    @Column(name = "comment_date", type = MySqlTypeConstant.DATETIME)
    private Date commentDate; // 评论日期时间

    @ApiModelProperty(value="审核状态：0-未审核，1-审核通过，2-审核未通过")
    @Column(name = "shield", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer shield;

    @TableLogic
    @ApiModelProperty(value="是否删除：1删除，0未删除")
    @Column(name = "is_del", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer isDel; // 是否删除：1删除，0未删除

    @Version
    @ApiModelProperty(value="数据版本号")
    @Column(name = "version", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer version; // 数据版本号

    @ApiModelProperty(value="用户基本信息")
    @TableField(exist = false)
    private UserInfoResData userInfo;

    @ApiModelProperty(value="当前用户是否点赞")
    @TableField(exist = false)
    private Boolean isThumbsUp = false; //当前用户是否点赞

    @ApiModelProperty(value="是否当前用户的评论")
    @TableField(exist = false)
    private Boolean isMine = false; //当前用户是否点赞

    @ApiModelProperty(value="评论图片列表")
    @TableField(exist = false)
    private List<UploadImageResData> commentImages;  // 评论图片列表

    @ApiModelProperty(value="评论回复列表")
    @TableField(exist = false)
    private List<GoodsCommentComment> commentComments;  // 评论回复列表

}

